#include <gtest\gtest.h>
#include <utils\smart_car_service_registry.h>
#include "..\mock\dummy_service_mock.h"


TEST(ut_smart_car_service_registry, validation)
{
	smart_car::smart_car_service_registry registry;

	dummy_service_mock* mock = new dummy_service_mock();
	EXPECT_TRUE(registry.add(smart_car::SMART_CAR_ENGINE, mock));
	EXPECT_FALSE(registry.add(smart_car::SMART_CAR_ENGINE, mock));

	registry.remove(smart_car::SMART_CAR_ENGINE);
	EXPECT_FALSE(registry.find(smart_car::SMART_CAR_ENGINE) == mock);

	EXPECT_TRUE(registry.add(smart_car::SMART_CAR_ENGINE, mock));

	EXPECT_TRUE(registry.find(smart_car::SMART_CAR_ENGINE) == mock);
}
